<?php

namespace App\Http\Requests\Backend;

class SpaceSchemeContentRequest  extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'thumb' => 'required',
            'category_id' => 'required',
            'sort' => 'required',

        ];
    }

    public function messages()
    {
        return [
            'title.required' => '请输入标题',
            'thumb.required' => '请上传封面',
            'category_id.required' => 'category_id必须有',
            'sort.required' => '排序必须有',
        ];
    }

    public function filldata()
    {
        return [
            'title' => $this->input('title'),
            'thumb' => $this->input('thumb'),
            'url' => $this->input('url'),
            'category_id' => $this->input('category_id'),
            'sort' => $this->input('sort'),
        ];
    }
}
